package com.sbl.bajw.pc.action;

import java.util.HashMap;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.sbl.bajw.common.web.RequestUnit;
import com.sbl.bajw.pc.service.SparkService;
import com.sbl.bajw.util.JsonUtil;

@Controller
@RequestMapping("/Spark")
public class SparkAction {
	
	@Resource
	private SparkService service;
	
	@RequestMapping(value = "/getCarGrid")
	public @ResponseBody String getCarGrid(HttpServletRequest request, HttpServletResponse response){
		HashMap<String, Object> parm = RequestUnit.getHashMapParmO();
		String result = service.getCarGrid(parm);
		String json = JsonUtil.ConvertObjectToJson(result);
		return json;
	}
	
	@RequestMapping(value = "/getCameraHouseGrid")
	public @ResponseBody String getCameraHouseGrid(HttpServletRequest request, HttpServletResponse response){
		HashMap<String, Object> parm = RequestUnit.getHashMapParmO();
		String result = service.getCameraHouseGrid(parm);
		String json = JsonUtil.ConvertObjectToJson(result);
		return json;
	}
	
	@RequestMapping(value = "/getCameraGrid")
	public @ResponseBody String getCameraGrid(HttpServletRequest request, HttpServletResponse response){
		HashMap<String, Object> parm = RequestUnit.getHashMapParmO();
		String result = service.getCameraGrid(parm);
		String json = JsonUtil.ConvertObjectToJson(result);
		return json;
	}
}
